package live_schedule

import (
	"github.com/gin-gonic/gin"
	"vrcm/src/vrcm/app/admin/apis/live_schedule"
	"vrcm/src/vrcm/app/admin/router"
	"vrcm/src/vrcm/common/middleware"
)

func init() {
	router.NoCheckRole = append(router.NoCheckRole, registerChannelTaskRouter)
}

// registerChannelTaskRouter
func registerChannelTaskRouter(v1 *gin.RouterGroup) {
	api := apis.ChannelTask{}
	r := v1.Group("/channel-task").Use(middleware.Options)
	{
		r.GET("", api.GetPage)
		r.GET("/:id", api.Get)
		r.POST("", api.Insert)
		r.PUT("/:id", api.Update)
		r.DELETE("", api.Delete)
		r.POST("/save-traffic-on", api.SaveTrafficOn)
		r.POST("/save-traffic-ons", api.SaveTrafficOns)
		r.POST("/get-traffic-on", api.GetTrafficOn)
		r.POST("/get-traffic-ons", api.GetTrafficOns)
		r.DELETE("/delete-traffic-on/:id", api.RemoveTrafficOn)
		r.DELETE("/delete-traffic-ons/:id", api.RemoveTrafficOns)
		r.POST("/save-media-process", api.SaveMediaProcess)
		r.GET("/get-media-process/:id", api.GetMediaProcess)
		r.DELETE("/delete-media-process/:id", api.RemoveMediaProcess)
		r.POST("/save-traffic-off", api.SaveTrafficOff)
		r.POST("/get-traffic-off", api.GetTrafficOff)
		r.DELETE("/delete-traffic-off/:id", api.RemoveGetTrafficOff)
		r.POST("/save-work-flow", api.SaveWorkflow1).Use(middleware.Options)
		//r.POST("/save-work-flow1", api.SaveWorkflow1)
		r.POST("/get-work-flow", api.GetWorkflow).Use(middleware.Options)
		r.POST("/start-work-flow", api.StartWorkflow).Use(middleware.Options)
		r.POST("/stop-work-flow", api.StopWorkflow).Use(middleware.Options)
		r.POST("/get-schedule-statistics", api.GetScheduleStatistics)
		r.POST("/convert-task-callback", api.ConvertTaskCallBack)
		r.POST("/audit-task-call-back", api.AuditTaskCallBack)
		r.POST("/audit-pull-task-call-back", api.AuditPullTaskCallBack)
		r.POST("/cortex-target-call-back", api.CortexTargetCallBack)
		r.POST("/update-cortex-output", api.UpdateCortexOutput)
		r.POST("/save-cortex", api.SaveCortex)
		r.POST("/create-cortex-task", api.CreateCortexTask)
		r.POST("/delete-cortex-task-by-out-name", api.DeleteCortexTaskByOutputName)
		r.POST("/switch-cortex-task", api.SwitchCortexSource)
		r.POST("/get-cortex-task-list", api.GetCortexTaskList).Use(middleware.Options)
		r.POST("/get-cortex-out-info", api.GetCortexOutInfo).Use(middleware.Options)
		r.POST("/start-cortex-task", api.StartCortexTask)
		r.POST("/stop-cortex-task", api.StopCortexTask)
		r.POST("/get-cortex-by-filter", api.GetCortexByFilter)
		r.POST("/audit-statistic-result", api.AuditStatisticResult)
		r.POST("/audit-call-back", api.AuditCallBack)
		r.POST("/check-up-used", api.CheckUpUsed)
		r.GET("/handle-websocket", api.HandleWebSocket)
		r.POST("/get-schedule-flow-statistics", api.GetScheduleFlowStatistics)
		r.POST("/start-or-stop-task-by-traffic-on", api.StartOrStopTaskByTrafficOn)
		r.POST("/start-or-stop-task-by-traffic-off", api.StartOrStopTaskByTrafficOff)
		r.POST("/start-or-stop-task-by-media-process", api.StartOrStopTaskByMediaProcess)
		r.POST("/get-up-media", api.GetUpMedia)
		r.POST("/trans-callback", api.TransCallBack)
		r.POST("/start-or-stop-node", api.StartOrStopNode)
		r.POST("/switch-source", api.SwitchSource)
	}
}
